﻿//
// (C) Copyright 2009 Irantha Suwandarathna (irantha@gmail.com)
// All rights reserved.
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EffiProz.Core.Lib;
using EffiProz.Core.Lib.IO;
using EffiProz.Core.DataTypes;


namespace EffiProz.Core.RowIO
{
    /**
   * Public interface for writing the data for a database row.
   *
   * @author sqlbob@users (RMP)
   * @author fredt@users
   * @version 1.7.2
   * @since 1.7.0
   */
    public interface RowOutputInterface
    {
        void writeEnd();

        void writeSize(int size);

        void writeType(int type);

        void writeString(String value);

        void writeByte(int i);

        void writeShort(int i);

        void writeInt(int i);

        void writeIntData(int i, int position);

        void writeLong(long i);

        void writeData(Object[] data, SqlType[] types);

        void writeData(int l, SqlType[] types, Object[] data, HashMappedList cols,
                       int[] primarykeys);

        // independent of the this object, calls only a static method
        int getSize(Row row);

        int getStorageSize(int size);

        // returns the underlying HsqlByteArrayOutputStream
        ByteArrayOutputStream getOutputStream();

        // sets the byte[] buffer
        void setBuffer(byte[] mainBuffer);

        // resets the byte[] buffer, ready for processing new row
        void reset();

        // returns the current size
        int size();

        RowOutputInterface clone();
    }
}

